<?php
// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH',
              realpath(dirname(__FILE__) . '/application'));
// Define path to application directory
defined('PUBLIC_PATH')
    || define('PUBLIC_PATH',
              realpath(dirname(__FILE__) . '/public'));
defined('DATE_FORMAT')
    || define('DATE_FORMAT',
              'yyyy-MM-dd');
            
              
// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV',
              (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV')
                                         : 'developer'));

// Typically, you will also want to add your library/ directory
// to the include_path, particularly if it contains your ZF installed
set_include_path(implode(PATH_SEPARATOR, array(
    dirname(__FILE__) . '/library',
    get_include_path(),
)));


/** Zend_Application */
require_once 'Zend/Application.php';

//$autoloader->setFallbackAutoloader('true');
$environment = APPLICATION_ENV;
$options = APPLICATION_PATH . '/configs/application.ini';
$application = new Zend_Application($environment, $options);
// Register plugin acl
$auth = Zend_Auth::getInstance();
$acl = new My_Acl($auth);
$frontController = Zend_Controller_Front::getInstance();
//Zend_Registry::set();

Zend_Registry::set('acl',$acl);

$frontController->registerPlugin(new My_Controller_Plugin_Acl($auth, $acl));
$frontController->registerPlugin(new My_Controller_Plugin_Layout());
$application->bootstrap()->run();




